<?php require_once("includes/session.php"); ?>
<?php //confirm_logged_in(); ?>

<html>
	<head>
		<meta charset=utf-8" />
		<title>Project Mayhem</title>
		<link href="stylesheets/public.css" media="all" rel="stylesheet" type="text/css" />
		<link href="stylesheets/print.css" media="print" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="tinymce/jscripts/tiny_mce/tiny_mce.js"></script>

<script type="text/javascript">
tinyMCE.init({
        theme : "advanced",
        mode : "textareas",
        plugins : "fullpage",
        theme_advanced_buttons3_add : "fullpage"
});
</script>
		
	</head>
	<body>
		<header>
        <table width="99%" border="0">
  <tr>
    <td><h1>Homepage v0.11a
			</h1></td>
    <td align="right"><a href="vartotojas.php"><?php echo $_SESSION['vardas']." ".$_SESSION['pavarde'];?></a><br><a href="logout.php">Atsijungti</a></td>
  </tr>
</table>
		</header>
					<nav>&nbsp;
<?php 	header('Content-Type: text/html; charset=UTF-8');

	$query = "SELECT * 
			FROM menus, permition
			WHERE `visible`=1";
	$query .=" AND menus.actionid = permition.actionid ";
	$query .=" AND permition.vartotojasid =";
	$query .=$_SESSION['vartotojasid'];
	$query .=" ORDER BY position ASC";
		$menu_set = mysql_query($query, $connection);
		confirm_query($menu_set);
while ($menu = mysql_fetch_array($menu_set)) {
				echo "<li><a href=". $menu["link"] . ">" . $menu["name"] . "</a></li>";
			};

?>

					</nav>